//
//  KeepInJobPeopleTableViewCell.m
//  MyProject
//
//  Created by jiaming yan on 2018/5/21.
//  Copyright © 2018年 yanjiaming. All rights reserved.
//

#import "KeepInJobPeopleTableViewCell.h"

@implementation KeepInJobPeopleTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}
-(void)setDataWithModel:(KeepInJobModel *)model{
    
 
    [self.headImageView sd_setImageWithURL:[NSURL URLWithString:ImageURL(model.headImg)] placeholderImage:IMAGE(@"默认图")];
    self.nameLabel.text = model.nickName;
    self.positionLabel.text = [NSString stringWithFormat:@"-已在职%zd年",model.inServiceTime];
    self.typeLabel.text = [NSString stringWithFormat:@"%@ | 帮助过%zd人",model.incumbentPositionName,model.helpedCount];
    self.inJobLabel.text = [NSString stringWithFormat:@"保过职位：%@",model.assurePassPositions];
    
    self.scoreLabel.text = [NSString stringWithFormat:@"%.0f%@",model.degreeOfSatisfaction*100,@"%"];
    
    CAShapeLayer *layerBack = [[CAShapeLayer alloc]init];
    layerBack.lineWidth = 4;
    //圆环的颜色
    layerBack.strokeColor = UIColorFromRGB(0xE2F2F4).CGColor;
    //背景填充色
    layerBack.fillColor = [UIColor clearColor].CGColor;
    //设置半径为10
    CGFloat radius = 22;
    //按照顺时针方向
    BOOL clockWise = true;
    //初始化一个路径
    UIBezierPath *pathBack = [UIBezierPath bezierPathWithArcCenter:CGPointMake(22 , 22 ) radius:radius startAngle:0 endAngle:2*M_PI clockwise:clockWise];
    //             UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(78 , 78 - 1 ) radius:radius startAngle:(2*M_PI) endAngle:(_score/100.0*2)*M_PI clockwise:clockWise];
    layerBack.path = [pathBack CGPath];
    [self.scoreView.layer addSublayer:layerBack];
    
    
    CAShapeLayer *layer = [CAShapeLayer new];
    layer.lineWidth = 4;
    //圆环的颜色
    layer.strokeColor = UIColorFromRGB(0x42CDD9).CGColor;
    //背景填充色
    layer.fillColor = [UIColor clearColor].CGColor;
    //设置半径为10
    
    
    //初始化一个路径
    UIBezierPath *path = [UIBezierPath bezierPathWithArcCenter:CGPointMake(22 , 22 ) radius:radius startAngle:3*M_PI_2 endAngle:(model.degreeOfSatisfaction*2*M_PI+3*M_PI_2) clockwise:clockWise];
    layer.path = [path CGPath];
    [self.scoreView.layer addSublayer:layer];
}
-(void)loadData{
    
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
